<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
	$edit		= JRequest::getVar('edit',true);
	$text = !$edit ? JText::_( 'Tạo mới' ) : JText::_( 'Sửa' );
	JToolBarHelper::title(   JText::_( 'Danh mục' ).': <small><small>[ ' . $text.' ]</small></small>' );
	JToolBarHelper::save();
	if (!$edit)  {
		JToolBarHelper::cancel();
	} else {		
		JToolBarHelper::cancel( 'Thoát', 'Đóng' );
	}	
	$editor =& JFactory::getEditor();
?>
<script language="javascript" type="text/javascript">
	function submitbutton(pressbutton) {
		var form = document.adminForm;
		if (pressbutton == 'cancel') {
			submitform( pressbutton );
			return;
		}
		if (form.title.value == ""){
			alert( "<?php echo JText::_( 'Bạn hãy nhập tên', true ); ?>" );
		} else if (form.parent_id.value == ""){
			alert( "<?php echo JText::_( 'Bạn hãy chọn danh mục', true ); ?>" );
		}
		else {
			submitform( pressbutton );
		}
	}
</script>
<form action="index.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">
<div class="col width-10">
<fieldset class="adminform">
    <legend><?php echo JText::_( 'Chi tiết' ); ?></legend>
    <table class="admintable">
    <tr>
        <td width="100" align="right" class="key">
            <label for="title">
                <?php echo JText::_( 'Name' ); ?>:
            </label>
        </td>
        <td>
            <input class="text_area" type="text" name="title" id="title" size="32" maxlength="250" value="<?php echo $this->detail->title;?>" />
        </td>
    </tr>   
    <tr>
        <td valign="top" align="right" class="key">
            <label for="catid">
                <?php echo JText::_( 'Category' ); ?>:
            </label>
        </td>
        <td>
            <?php echo $this->lists['sel']; ?>
        </td>
    </tr> 
    <tr>
        <td valign="top" align="right" class="key">
            <label for="catid">
                <?php echo JText::_( 'Vị trí' ); ?>:
            </label>
        </td>
        <td>
            <?php echo $this->lists['position']; ?>
        </td>
    </tr>   	
    <tr>
        <td valign="top" align="right" class="key">
            <?php echo JText::_( 'Published' ); ?>:
        </td>
        <td>
            <?php echo $this->lists['published']; ?>
        </td>
	</tr>
    </table>
</fieldset>
</div>
<input type="hidden" name="created" value="<?php echo $this->detail->created;?>" />
<input type="hidden" name="option" value="com_danhmuc" />
<input type="hidden" name="cid[]" value="<?php echo $this->detail->id; ?>" />
<input type="hidden" name="task" value="" />
</form>